snapshot: Implement gtk_snapshot_clips_rect()
authorBenjamin Otte <otte@redhat.com>
Thu, 17 Nov 2016 02:31:15 +0000 (03:31 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 17 Nov 2016 02:33:50 +0000 (03:33 +0100)
commitab60cbd86a852121a7181275a45545070d06f6a6
tree5ce1ce16467fcb31983d60526f31e2e385be2359
parent28b32d336f8ce3a36f4930cc3dd991264adc213a
snapshot: Implement gtk_snapshot_clips_rect()

And use this to cull widgets and gadgets that are completely outside the
clip region.

A potential optimization is to apply this clip region to cairo contexts
created with gtk_snapshot_append_cairo_node(), but for that we'd need to
apply the inverse matrix to the clip region, and that causes rounding
errors.

Plus, I hope that cairo drawing becomes exceedingly rare so it won't be
used for the whole widget factory like today (which might also explain
why no culling happens in the widget factory outside the header bar.
gtk/gtksnapshot.c
gtk/gtksnapshotprivate.h
gtk/gtkwidget.c